home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Tele
/
T
/
The Survey Editor2.0.HC.cpt
/
The Survey Editor 2.0
/
card_4495.txt
< prev
next >
Wrap
Text File
|
1990-01-30
|
13KB
|
512 lines
-- card: 4495 from stack: in.0
-- bmap block id: 5257
-- flags: 0000
-- background id: 2767
-- name: input
----- HyperTalk script -----
on openCard
menuHandler "hide","editor",0
menuHandler "hide","Commands",0
put "" into cd field "name"
put "" into cd field "branch"
put "" into cd field "input"
put "" into cd field "comment"
put 0 into cd field "length"
show cd btn "ok"
end openCard
on closeCard
menuHandler "hide","Insert Control..."
menuHandler "show","editor",0
menuHandler "show","Commands",0
show cd btn "cancel"
show cd btn "ok"
end closeCard
on domenu which
if which is in "Bell,Tab,Clear Screen,Backspace,(-,Other..." then
if which is "Bell" then put NumToChar(7) after cd field "input"
if which is "Tab" then put NumToChar(10) after cd field "input"
if which is "Clear Screen" then put NumToChar(12) after cd field "input"
if which is "Backspace" then put NumToChar(8) after cd field "input"
if which is "other..." then
ask "Value of the ASCII character to insert?"
if it is empty then exit domenu
repeat with x = 1 to the number of chars in it
if charToNum(char x of it) < 48 or charToNum(char x of it) > 57 then
answer "Sorry, numbers only!"
exit domenu
end if
end repeat
put NumToChar(it) after cd field "input"
end if
else
pass domenu
end if
end domenu
-- initiate nameFlag,nameLabel,lengthFlag,lengthLabel,branchFlag, -- branchLable,inputFlag,inputLabel,CRflag,SFGetFlag,commandNumber,
-- displayString (verbose of the commandNumber)
on initiate nameFlag,NameLabel,lengthFlag,LengthLabel,branchFlag, branchLabel,inputFlag,InputLabel,CRflag,SFGetFlag,commandNumber, displayString
if nameFlag is false then
hide cd field "name Label"
hide cd field "name"
else
put nameLabel into cd field "name label"
show cd field "name Label"
show cd field "name"
end if
if lengthFlag is false then
hide cd field "Length Label"
hide cd field "Length"
else
put LengthLabel into cd field "Length label"
show cd field "Length Label"
show cd field "Length"
end if
if branchFlag is false then
hide cd field "Branch Label"
hide cd field "branch"
else
put branchlabel into cd field "branch label"
show cd field "branch Label"
show cd field "branch"
end if
if inputFlag is false then
hide cd field "input Label"
hide cd field "input"
else
put inputlabel into cd field "input label"
show cd field "input Label"
show cd field "input"
end if
if CRflag is true then show cd btn id 2 --Terminate with a CR
else hide cd btn id 2
if SFGetFlag is true then show cd btn id 3 -- get path name
else hide cd btn id 3
put commandNumber into cd field "command"
put displayString into cd field "display"
unlock screen with barn door open
if the visible of cd field "input" is true
then menuHandler "show","Insert Control..."
put offset("•",cd field "display") into rsx
if rsx ≠ 0 then
delete char rsx to (number of chars in cd field "display") of cd field "display"
end if
if commandNumber > 21 and commandNumber < 26 then
show cd btn "flag number"
put "x." into last word of cd field "display"
else
hide cd btn "flag number"
end if
end initiate
on idle
if the visible of cd field "input" is false then exit idle
if number of chars in cd field "input" > 79 then
if the visible of cd btn "ok" is false then exit idle
answer "Sorry! Cannot accept more than 79 characters."
hide cd btn "ok"
else
show cd btn "ok"
end if
end idle
on returnKey
if the visible of cd btn "ok" is true
then click at the loc of cd btn "ok"
end returnKey
on arrowKey
end arrowKey
-- part 1 (button)
-- low flags: 00
-- high flags: C002
-- rect: left=0 top=0 right=20 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: The Survey Editor 2.0 (c) 1990 Pierrot Vachon
-- part 3 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=410 top=229 right=249 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Get path...
----- HyperTalk script -----
on mouseUp
put "" into theType
put cd field "command" into commandNumber
if commandNumber = 18 then put "MENU" into theType
if commandNumber = 26 or commandNumber = 27 or commandNumber = 28 or commandNumber = 29 then put "TEXT" into theType
put FileName(theType,"Please select a file...") into fichier
if fichier ≠ "" then
if the visible of cd field "input" is true
then put fichier into cd field "input"
else put fichier into cd field "branch"
end if
end mouseUp
-- part 4 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=20 top=58 right=92 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: display
-- part 5 (field)
-- low flags: 02
-- high flags: 0002
-- rect: left=20 top=250 right=288 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 12
-- style flags: 16384
-- line height: 18
-- part name: input
----- HyperTalk script -----
on returnInField
if checkASCII(target) is true then
answer "Sorry, this field contains a non ASCII character."
exit returnInField
end if
click at the loc of cd btn "ok"
end returnInField
on enterInField
returnInField
end enterInField
-- part 6 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=17 top=230 right=247 bottom=409
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: input label
----- HyperTalk script -----
on returnInField
click at the loc of cd btn "ok"
end returnInField
-- part 7 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=158 top=302 right=327 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Cancel
----- HyperTalk script -----
on mouseUp
go cd 1
end mouseUp
-- part 8 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=279 top=302 right=327 bottom=354
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: OK
----- HyperTalk script -----
on mouseUp
ok true
end mouseUp
on ok
put "name,comment,branch,input,length" into fieldLIST
repeat with y = 1 to 5
repeat while offset(return,cd field item y of fieldLIST) ≠ 0
put "" into char offset(return,cd field item y of fieldLIST) of cd field item y of fieldLIST
end repeat
end repeat
put upper(cd field "name") into label
put upper(cd field "branch") into branch
put cd field "input" into text
put cd field "length" into length
put cd field "comment" into comment
if length = "" then put 0 into length
put cd field "command" into commande
if commande = 1 then
if the hilite of cd btn id 2 is true then -- end with a return
put 0 into length
else
put 1 into length
end if
end if
go cd 1
put compute(label,commande,text,length,branch) into displayString
if the hilite of cd btn "label above command" is true then
put offset("•",displayString) into Xstart
put the number of chars in displayString into Xend
put char Xstart to Xend of displayString & return into temp
delete char Xstart to Xend of displayString
put temp before displayString
end if
put comment & return & label & return & commande & return & text & return & length & return & branch into command
WRTstrg command,displayString, line 1 of cd field "action",line 2 of cd field "action"
end ok
on cancel
ok false
end cancel
-- part 9 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=93 top=113 right=135 bottom=122
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: command
-- part 10 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=190 top=113 right=135 bottom=325
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: name label
-- part 11 (field)
-- low flags: 00
-- high flags: 0002
-- rect: left=324 top=113 right=135 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: name
----- HyperTalk script -----
on returnInField
if checkASCII(target) is true then
answer "Sorry, this field contains a non ASCII character."
exit returnInField
end if
click at the loc of cd btn "ok"
end returnInField
on enterInField
returnInField
end enterInField
-- part 12 (field)
-- low flags: 81
-- high flags: 0000
-- rect: left=20 top=194 right=216 bottom=140
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: length label
-- part 2 (button)
-- low flags: 80
-- high flags: E005
-- rect: left=256 top=232 right=249 bottom=494
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Terminate with a carriage return
-- part 13 (field)
-- low flags: 80
-- high flags: 0002
-- rect: left=138 top=194 right=216 bottom=168
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: length
----- HyperTalk script -----
on returnInField
click at the loc of cd field "input"
end returnInField
-- part 14 (field)
-- low flags: 81
-- high flags: 0000
-- rect: left=193 top=194 right=216 bottom=324
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: branch label
-- part 15 (field)
-- low flags: 80
-- high flags: 0002
-- rect: left=323 top=194 right=216 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: branch
----- HyperTalk script -----
on returnInField
click at the loc of cd btn "ok"
end returnInField
-- part 16 (field)
-- low flags: 00
-- high flags: 0002
-- rect: left=20 top=159 right=181 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 12
-- style flags: 0
-- line height: 18
-- part name: comment
----- HyperTalk script -----
on returnInField
end returnInField
-- part 19 (button)
-- low flags: 80
-- high flags: 8004
-- rect: left=142 top=230 right=249 bottom=247
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Flag Number
----- HyperTalk script -----
on mouseDown
set the hilite of me to true
set cursor to arrow
put "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24" into flagMENU
put PopUpMenu (flagMENU,"",item 3 of the rect of me, item 4 of the rect of me-220) into theITEM
set the hilite of me to false
if theITEM = 0 then exit mouseDown
put item theITEM of flagMENU into cd field "input"
end mouseDown
-- part contents for card part 10
----- text -----
Label:
-- part contents for card part 12
----- text -----
Length:
-- part contents for card part 6
----- text -----
Text file to display:
-- part contents for card part 9
----- text -----
28
-- part contents for card part 14
----- text -----
Branch to:
-- part contents for card part 13
----- text -----
0
-- part contents for card part 4
----- text -----
Display TEXT file. Not cancellable, all prompts...